using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Shpm.App.Input.Bean;
using System.Collections;
using Shpm.System.Db;

/// <summary>
/// Summary description for EvaluationSrhDao
/// </summary>
public class EvaluationSrhDao : ShpmBaseDao
{
    public EvaluationSrhDao()
    {
        //
        // TODO: Add constructor logic here
        //
    }

    public const string LIST_CLASS = "EvaluationSrh.ListClass";
    public const string LIST_STUDENT = "EvaluationSrh.ListStudent";
    public const string GET_STUDENT = "EvaluationSrh.GetStudent";
    public const string UPD_STUDENT = "EvaluationSrh.UpdStudent";
    public const string UPD_TEACHER = "EvaluationSrh.UpdTeacher";

    public IList ListClass(EvaluationSrhBean paramBean)
    {
        return base.QueryForList(LIST_CLASS, paramBean);
    }

    public IList ListStudent(EvaluationUpdBean paramBean)
    {
        return base.QueryForList(LIST_STUDENT, paramBean);
    }

    public EvaluationUpdBean GetStudent(EvaluationUpdBean paramBean)
    {
        return (EvaluationUpdBean)base.QueryForObject(GET_STUDENT, paramBean);
    }

    public int UpdStudent(EvaluationUpdBean paramBean)
    {
        return base.Update(UPD_STUDENT, paramBean);
    }

    public int UpdTeacher(EvaluationUpdBean paramBean)
    {
        return base.Update(UPD_TEACHER, paramBean);
    }

    public void Upd(IList list)
    {
        try
        {
            base.BeginTransaction();
            for (int i = 0; i < list.Count; i++)
            {
                EvaluationUpdBean bean = (EvaluationUpdBean)list[i];
                UpdTeacher(bean);
            }

            base.CommitTransaction();
        }
        catch (Exception e)
        {
            //log.Fatal(e);
            base.RollBackTransaction();
            throw new DataAccessException(e);
        }
    }
}
